package generic.method;

import utils.Log;

import java.util.ArrayList;
import java.util.List;

public class GenericVarargs {

    public static <T> List<T> makeList(T... args) {
        List<T> result = new ArrayList<>();
        for (T item : args) {
            result.add(item);
        }

        return result;
    }


    public static void main(String[] args) {
        List<String> ls = makeList("A");
        Log.vn(ls);

        ls = makeList("A", "B", "C");
        Log.vn(ls);

        ls = makeList();
        Log.vn(ls);

        ls = makeList("ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""));
        Log.vn(ls);
    }
}
